home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / adaptor.zip / ADAPT.ZIP / adaptor / dalib / pvm3 / transps0.c < prev    next >
Text File  |  1994-01-03  |  2KB  |  46 lines

  1. /**************************************************************************
  2. *                                                                         *
  3. *  Author      : Falk Zimmermann, GMD, I1.HR                              *
  4. *  Copyright   : GMD St. Augustin, Germany                                *
  5. *  Date        : Jun 93                                                   *
  6. *  Last Update : Jun 93                                                   *
  7. *                                                                         *
  8. *  This Module is part of the DALIB                                       *
  9. *                                                                         *
  10. *  Module      : transpose0.c                                             *
  11. *                                                                         *
  12. *  Function    : Transposing of a 2-dimensional replicated/host array     *
  13. *                                                                         *
  14. *  Export      : dalib_ltranspose_()                                      *
  15. *                                                                         *
  16. *  void dalib_ltranspose_ (target, source, N1, N2, size)                  *
  17. *  unsigned char *source, *target;                                        *
  18. *  int *N1, *N2;                                                          *
  19. *  int *size;                                                             *
  20. *                                                                         *
  21. **************************************************************************/
  22.  
  23. # undef DEBUG
  24.  
  25. #include "system.h"
  26.  
  27.  
  28. # define DIM 4       /* maximal supported dimension */
  29.  
  30.  
  31. void dalib_ltranspose__ (target, source, N1, N2, size)
  32. unsigned char *source, *target;
  33. int *N1, *N2;
  34. int *size;
  35. {  int j,k,ofssou1,ofssou2,ofstar;
  36.  
  37.    ofssou1 = *N2 * *size;
  38.    for (j=0;j < *N2;j++)
  39.      { ofssou2 = j * *size;
  40.        ofstar = j * *N1 * *size;
  41.        for (k=0;k < *N1;k++)
  42.      dalib_memcpy (target+ofstar+k* *size,source+ofssou2+ofssou1*k,*size);
  43.     }
  44. }
  45.  
  46.